//
//  LGCache.h
//  UniverseProject
//
//  Created by king on 2021/6/25.
//  Copyright © 2021 Cloud2209. All rights reserved.
//  本地缓存数据管理文件,封装EGO


#import <EGOCache.h>
#import "Singleton.h"
#import <Foundation/Foundation.h>

//第一次启动
static NSString* _Nonnull const APP_FIRST_START = @"APP_FIRST_START";

//刷新token
static NSString* _Nonnull const CURRENT_TOKEN = @"token";
static NSString* _Nonnull const REFRESH_TOKEN = @"refresh_token";
static NSString* _Nonnull const NEED_TOKEN = @"NEED_TOKEN";


NS_ASSUME_NONNULL_BEGIN


@interface LGCache : NSObject
SingletonH(LGCache)


/// 保存字符串
/// @param record <#record description#>
/// @param key <#key description#>
+ (void)saveStringRecord:(NSString *)record ByKey:(NSString *)key;


/// 获取字符串
/// @param key <#key description#>
+ (nullable NSString *)getStringRecordByKey:(NSString *)key;


/// 保存一个遵循nscoding协议的对象
/// @param obj <#obj description#>
/// @param key <#key description#>
+ (void)saveObject:(nonnull id<NSCoding>)obj ByKey:(NSString *)key;


/// 读取一个对象
/// @param key <#key description#>
+ (nullable id<NSCoding>)getObjByKey:(NSString *)key;


@end

NS_ASSUME_NONNULL_END
